/**
 * @file   Tree.cpp
 * @author xingyifan
 * @date   2021/08/20 20:35:42
 * 
 * @brief  the functions that tree needs
 * 
 * 
 */

#include "Tree.h"

/**
 * @file   Tree.cpp
 * @author xingyifan
 * @date   2021/08/19 22:14:34
 * 
 * @brief  print function
 * 
 * 
 */

void print_blank(int n)
{
    while (n > 0)
    {
        cout << " ";
        n--;
    }
}

void print_(int n)
{
    while (n > 0)
    {
        cout << "-";
        n--;
    }
}

void print_b(int n)
{
    while (n > 0)
    {
        cout << "\b";
        n--;
    }
}

/**
 * @file   Tree.cpp
 * @author xingyifan
 * @date   2021/08/20 00:06:58
 * 
 * @brief  获取整型的位数
 * 
 * 
 */

int digit(int n)
{
    if (n < 10 && n >= 0)
    {
        return 1;
    }
    else if (n > -10 && n < 0)
    {
        return 2;
    }
    else
    {
        return digit(n / 10) + 1;
    }
}